#include "base\macros.h";
WAITINIT(ied);

if(!isServer) exitWith{};
_position = _this select 0;
if (typename _position == typename "") then {
	_position = markerPos _position;
};
if ((_position distance [0,0,0]) > 0) then {
	_detection_distance = 15;
	_all_ieds = ["Land_IED_v1_PMC","Land_IED_v2_PMC","Land_IED_v3_PMC","Land_IED_v4_PMC"];
	_ied_type = _all_ieds select (floor (random (count _all_ieds)));
	_ammo = "R_57mm_HE";
	_trust = 1;
	_complex = 0;
	if (count _this > 1) then { if ((_this select 1) > 0) then { _detection_distance = _this select 1 };};
	if (count _this > 2) then { if ((_this select 2) != "") then { _ied_type = _this select 2 };};
	if (count _this > 3) then { if ((_this select 3) != "") then { _ammo = _this select 3 };};
	if (count _this > 4) then { _trust = _this select 4 };
	if (count _this > 5) then { _complex = _this select 5 };
	[d_side_own, _position, _detection_distance, _ied_type, _ammo, _trust, _complex] call R3F_FNCT_IED;
};